<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
    <title>休闲网登录页面</title>
	<link href="css/register.css" rel="stylesheet">
</head>
<body>
    <div id="header" class="main">
        <div id="headerLeft">
            <img src="images/logo.gif" /></div>
        <div id="headerRight">注册 | 登录 | 帮助</div>
    </div>
    <div class="register">
		<form action="success.html" id="myform" method="post" name="myform" >
			<ul>
				<li class="bold">登录休闲网</li>
				<li><span>Email：</span><input id="email" type="text" class="inputs" /><span class="err"></span></li>
				<li><span>姓名：</span><input id="name" type="text" class="inputs" /></li>
				<li><span>密码：</span><input type="password" class="inputs" /></li>
				<li><input name="btn" id="btn" type="submit" value="登录" class="rb1"  /></li>
			</ul>
		</form>
    </div>
    <div id="footer" class="main"><a href="#">关于我们</a> | <a href="#">诚聘英才</a> |<a href="#"> 联系方式</a>  | <a href="#">帮助中心</a></div>
	<script  src="js/jquery-1.12.4.js"></script>
	<script src="../../js/layer/layer.js"></script>
	<script>
		$(document).ready(function(){
			$("#myform").submit(function () {
				var email = $("#email").val();
				var name = $("#name").val();
				if(email==""){
					// layer.alert('邮箱不能为空');
					$("#email").addClass("border-red").next().text('邮箱不能为空')
					return false;
				}
				if(email.indexOf("@")==-1||email.indexOf(".")==-1){
					$("#email").addClass("border-red").next().text('邮箱格式不正确')
					return false;
				}
				if(name==""){
					layer.alert('姓名不能为空');
					return false;
				}
				for (const n of name) {
					if(isNaN(n)==false){//是数字
						layer.alert('姓名不能包含数字');
						return false;
					}
				}
				return true;//false
			})
		})
	</script>
</body>
</html>

